<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>form-tow-way-binding</title>
	<script src="../js/react.js"></script>
    <script src="../js/react-dom.js"></script>
    <script src="../js/browser.min.js"></script>
</head>
<body>
	<h1>form-tow-way-binding</h1>
	<div id="example"></div>
	<script type="text/babel">
		var MyInput = React.createClass({
			getInitialState: function() {
				return {value: "Hello"};
			},
			handleChange: function(event) {
				this.setState({value: event.target.value});
			},
			render: function() {
				var val = this.state.value;
				return (<div>
					<input type="text" value={val} onChange={this.handleChange} />
					<p>{val}</p>
					</div>
				);
			}
		});

		ReactDOM.render(
			<MyInput />,
			document.querySelector("#example")
		);
	</script>
</body>
</html>